package com.graduate.Test;

import com.graduate.Test.dao.UserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by yongqiangyao on 2017/11/29.
 */
@Controller
public class Test
{
    @Autowired
    private  UserMapper userMapper;

    @RequestMapping("/hello")
    public String  hello(){
        System.out.println("111111111");
        return "views/main";
    }

    @RequestMapping("/Test")
    @ResponseBody
    public String  Test(){
      return  userMapper.selectByPrimaryKey(1).getName();
    }
}
